<template>
	<view>
		pinia 大菠萝，doubleCount:{{doubleCount}}
		<button @click="setCount(count+1)">{{count}}</button>		 <button 
		@click="counterStore.count++"
		type="primary">{{counterStore.count}}</button>		 
	</view>
</template>
<script>
	import {useCounterStore} from '@/stores/useCounterStore.js'
	// mapState 映射状态，mapActions映射动作,mapStores 导入仓库
	import {mapState,mapActions,mapStores} from 'pinia';
	export default {
		data(){},
		computed:{
			// 把pinia 的state映射到页面
			...mapState(useCounterStore,["count","doubleCount"]),
			...mapStores(useCounterStore)
		},
		methods:{
			// 把pinia的方法映射到页面
			...mapActions(useCounterStore,["setCount"])
		},
	}
</script>